home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / GMS / GMSDev / Includes / graphics / screens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-11  |  7.9 KB  |  215 lines

  1. #ifndef GRAPHICS_SCREENS_H
  2. #define GRAPHICS_SCREENS_H TRUE
  3.  
  4. /*
  5. **  $VER: screens.h V1.0
  6. **
  7. **  Screen Definitions
  8. **
  9. **  (C) Copyright 1996-1998 DreamWorld Productions.
  10. **      All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <dpkernel/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Screen Object.
  19. */
  20.  
  21. #define VER_SCREEN  1
  22. #define TAGS_SCREEN ((ID_SPCTAGS<<16)|ID_SCREEN)
  23.  
  24. typedef struct GScreen {
  25.   struct Head Head;        /* [00] Standard structure header */
  26.   APTR   MemPtr1;          /* [12] Ptr to screen 1 */
  27.   APTR   MemPtr2;          /* [16] Ptr to screen 2 (double buffer) */
  28.   APTR   MemPtr3;          /* [20] Ptr to screen 3 (triple buffer) */
  29.   struct GScreen *Link;    /* [24] Reserved */
  30.   struct Raster  *Raster;  /* [28] Ptr to a raster object */
  31.   WORD   Width;            /* [32] The width of the visible screen */
  32.   WORD   Height;           /* [34] The height of the visible screen */
  33.   WORD   XOffset;          /* [36] Hardware co-ordinate for TOS */
  34.   WORD   YOffset;          /* [38] Hardware co-ordinate for LOS */
  35.   WORD   BmpXOffset;       /* [40] Offset of the horizontal axis */
  36.   WORD   BmpYOffset;       /* [42] Offset of the vertical axis */
  37.   WORD   ScrMode;          /* [44] What screen mode is it? */
  38.   WORD   reserved;         /* [46] Reserved. */
  39.   LONG   Attrib;           /* [48] Special Attributes are? */
  40.   struct DPKTask *prvTask; /* [52] Private */
  41.   struct Bitmap  *Bitmap;  /* [56] Bitmap */
  42.   WORD   Switch;           /* [60] R: Set to switch the buffers */
  43.  
  44.   /* Private fields */
  45.  
  46.   WORD   prv;                  /*  1 */
  47.   APTR   prvTypeEmulator;      /*  2 Emulation */
  48.   APTR   prvMonitor;           /*  3 Monitor driver */
  49.   APTR   prvEMemPtr1;          /*  4 Chunky driver */
  50.   APTR   prvEMemPtr2;          /*  5 Chunky driver */
  51.   APTR   prvEMemPtr3;          /*  6 Chunky driver */
  52.   APTR   prvEFree1;            /*  7 Chunky driver */
  53.   APTR   prvEFree2;            /*  8 Chunky driver */
  54.   APTR   prvEFree3;            /*  9 Chunky driver */
  55.   BYTE   prvColBits;           /* 10 0 = 12bit, 1 = 24bit */
  56.   BYTE   prvPad;               /* 11 Unused */
  57.   LONG   prvShowKey;           /* 12 Resource key if the screen is shown */
  58.   LONG   prvScratch;           /* 13 Scratch address! */
  59.   struct ScreenPrefs *Prefs;   /* 14 Screen preferences for this screen */
  60.   APTR   prvLineWait;          /* 15 Line Wait till bitplanes start */
  61.   WORD   *prvEnd;              /* 16 Ptr to the copper's jump end */
  62.   WORD   prvBurstLevel;        /* 17 FMode setting for bitplanes */
  63.   struct Control *prvControl;  /* 18 BPLCON0 */
  64.   APTR   prvModulo;            /* 19 The screen modulo */
  65.   APTR   prvScrPosition;       /* 20 DIW's, DDF's, DIWHIGH */
  66.   APTR   prvStart;             /* 21 Start of main copperlist */
  67.   APTR   prvSprites;           /* 22 Pointer to the copper sprites */
  68.   APTR   prvColours;           /* 23 Pointer to the copper colours */
  69.   WORD   prvAmtBankCols;       /* 24 Amount of colours per bank (AGA) */
  70.   WORD   prvAmtBanks;          /* 25 Amount of banks in total (AGA) */
  71.   WORD   prvHiLoOffset;        /* 26 Offset between hi and lo bits (AGA) */
  72.   BYTE   *prvBitplanes1;       /* 27 Ptr to copper bitplane loaders #1 */
  73.   BYTE   *prvBitplanes2;       /* 28 Ptr to copper bitplane loaders #2 */
  74.   BYTE   *prvBitplanes3;       /* 29 Ptr to copper bitplane loaders #3 */
  75.   LONG   prvColListJmp;        /* 30 Offset to RasterList */
  76.   LONG   prvBmpXOffset;        /* 31 X offset for scrolling */
  77.   LONG   prvBmpYOffset;        /* 32 Y offset for scrolling */
  78.   WORD   prvScrollBWidth;      /* 33 Set to 2 if scrolling */
  79.   APTR   prvMemPtr1;           /* 34 Original screen mem start (1) */
  80.   APTR   prvMemPtr2;           /* 35 Original screen mem start (2) */
  81.   APTR   prvMemPtr3;           /* 36 Original screen mem start (3) */
  82.   WORD   prvBPLCON3;           /* 37 BPLCON3 actual data (not a ptr) */
  83.   WORD   prvAmtFields;         /* 38 Amount of PlayFields on screen */
  84.   WORD   prvFieldNum;          /* 39 Number of this field */
  85.   WORD   prvScrLRWidth;        /* 40 ScrWidth, in lo-resolution */
  86.   WORD   prvScrLRBWidth;       /* 41 ScrByteWidth, in lo-resolution */
  87.   WORD   prvPicLRWidth;        /* 42 PicWidth, in lo-resolution */
  88.   WORD   prvTOSX;              /* 43 Top of screen X for this screen */
  89.   WORD   prvTOSY;              /* 44 Top of screen Y for this screen */
  90.   APTR   prvCopperMem;         /* 45 Pointer to original screen mem start */
  91.   struct Bitmap *prvBitmap;    /* 46 Allocated bitmap */
  92.   WORD   prvBlitXOffset;       /* 47 Offset to use for blitting (hard-scroll) */
  93.   LONG   *prvPalette;          /* 48 Allocated palette */
  94.   APTR   prvBufPtr1;           /* 49 */
  95.   APTR   prvBufPtr2;           /* 50 */
  96.   APTR   prvBufPtr3;           /* 51 */
  97. } OBJ_SCREEN;
  98.  
  99. /* Screen Buffer names, these are asked for in the blitter functions */
  100.  
  101. #define BUFFER1  12
  102. #define BUFFER2  16
  103. #define BUFFER3  20
  104.  
  105. /* SCREEN ATTRIBUTES (Attrib) */
  106.  
  107. #define SCR_DBLBUFFER    0x00000001   /* For double buffering */
  108. #define SCR_TPLBUFFER    0x00000002   /* Triple buffering!! */
  109. /*#define SCR_PLAYFIELD  0x00000004    Set if it's part of a playfield */
  110. #define SCR_HSCROLL      0x00000008   /* Gotta set this to do scrolling */
  111. #define SCR_VSCROLL      0x00000010   /* For vertical scrolling */
  112. /*#define SCR_SPRITES    0x00000020    Set this if you want sprites */
  113. #define SCR_SBUFFER      0x00000040   /* Create a buffer for horiz scrolling */
  114. #define SCR_CENTRE       0x00000080   /* Centre the screen (sets XOffset/YOffset) */
  115. #define SCR_BLKBDR       0x00000100   /* Gives a blackborder on AGA machines */
  116. #define SCR_NOSCRBDR     0x00000200   /* For putting sprites in the border */
  117.  
  118. /* SCREEN MODES (ScrMode) */
  119.  
  120. #define SM_HIRES   0x0001       /* High resolution */
  121. #define SM_SHIRES  0x0002       /* Super-High resolution */
  122. #define SM_LACED   0x0004       /* Interlaced */
  123. #define SM_LORES   0x0008       /* Low resolution (default) */
  124. #define SM_SLACED  0x0020       /* Super-Laced resolution */
  125.  
  126. /* Screen Tags */
  127.  
  128. #define GSA_MemPtr1    (12|TAPTR)
  129. #define GSA_MemPtr2    (16|TAPTR)
  130. #define GSA_MemPtr3    (20|TAPTR)
  131. #define GSA_Raster     (28|TAPTR)
  132. #define GSA_Width      (32|TWORD)
  133. #define GSA_Height     (34|TWORD)
  134. #define GSA_XOffset    (36|TWORD)
  135. #define GSA_YOffset    (38|TWORD)
  136. #define GSA_BmpXOffset (40|TWORD)
  137. #define GSA_BmpYOffset (42|TWORD)
  138. #define GSA_ScrMode    (44|TWORD)
  139. #define GSA_Attrib     (48|TLONG)
  140. #define GSA_BitmapTags (56|TSTEPIN)
  141.  
  142. /****************************************************************************
  143. ** Raster object.
  144. */
  145.  
  146. #define VER_RASTER  1
  147. #define TAGS_RASTER ((ID_SPCTAGS<<16)|ID_RASTER)
  148.  
  149. typedef struct Raster {
  150.   struct Head Head;        /* Standard header */
  151.   struct RHead   *Command; /* Pointer to the first command */
  152.   struct GScreen *Screen;  /* Pointer to our Screen owner */
  153.   LONG   Flags;            /* Special flags */
  154.  
  155.   /*** Private fields ***/
  156.  
  157.   APTR   prvRasterMem;
  158. } OBJ_RASTER;
  159.  
  160. #define RSF_DISPLAYED 0x00000001   /* If the raster is currently on display */
  161.  
  162. /****************************************************************************
  163. ** Rasterlist command header format.
  164. */
  165.  
  166. struct RStats {
  167.   LONG  CopSize;
  168.   UWORD *CopPos;
  169. };
  170.  
  171. struct RHead {
  172.   WORD   ID;
  173.   WORD   Version;
  174.   struct RStats *Stats;
  175.   struct RHead  *Prev;
  176.   struct RHead  *Next;
  177. };
  178.  
  179. /****************************************************************************
  180. ** These are the raster command structures.
  181. */
  182.  
  183. #define ID_RASTWAIT       1
  184. #define ID_RASTFLOOD      2
  185. #define ID_RASTCOLOUR     3
  186. #define ID_RASTCOLOURLIST 4
  187. #define ID_RASTMIRROR     5
  188.  
  189. #define ID_RASTEND        6
  190.  
  191. typedef struct RWait {
  192.   struct RHead Head;
  193.   WORD   Line;
  194. } RMD_WAIT;
  195.  
  196. typedef struct RFlood {
  197.   struct RHead Head;
  198. } RMD_FLOOD;
  199.  
  200. typedef struct RColour {
  201.   struct RHead Head;
  202.   LONG   Colour;
  203.   LONG   Value;
  204. } RMD_COLOUR;
  205.  
  206. typedef struct RColourList {
  207.   struct RHead Head;
  208.   WORD   YCoord;
  209.   WORD   Skip;
  210.   LONG   Colour;
  211.   LONG   *Values;
  212. } RMD_COLOURLIST;
  213.  
  214. #endif /* GRAPHICS_SCREENS_H */
  215.